<?php
/**
 * Load tabs with ajax
 *
 */
?>
elgg.provide('elgg.org');

elgg.org.loadAjaxTabs = function()
{
	$("ul.elgg-tabs > li > a").click(function(event)
	{
		event.preventDefault();
		$("#section_content").html('<?php echo elgg_view("js/organizations/loading"); ?>');
		//Visual changes on tabs
		$("ul.elgg-tabs > li").removeClass(" elgg-state-selected");
		$(this).parent().addClass(" elgg-state-selected");
		
		//Ajax request
		var href = this.href+'?ajax=1';
		$("#section_content").load(href);
	});
}
